import 'package:love_newf/generated/json/base/json_convert_content.dart';
import 'package:love_newf/app/com/model/request_default_params_model.dart';

RequestDefaultParamsModel $RequestDefaultParamsModelFromJson(
    Map<String, dynamic> json) {
  final RequestDefaultParamsModel requestDefaultParamsModel = RequestDefaultParamsModel();
  final String? appVersion = jsonConvert.convert<String>(json['appVersion']);
  if (appVersion != null) {
    requestDefaultParamsModel.appVersion = appVersion;
  }
  final String? sessionId = jsonConvert.convert<String>(json['sessionId']);
  if (sessionId != null) {
    requestDefaultParamsModel.sessionId = sessionId;
  }
  final String? adid = jsonConvert.convert<String>(json['adid']);
  if (adid != null) {
    requestDefaultParamsModel.adid = adid;
  }
  final String? deviceId = jsonConvert.convert<String>(json['deviceId']);
  if (deviceId != null) {
    requestDefaultParamsModel.deviceId = deviceId;
  }
  final String? deviceName = jsonConvert.convert<String>(json['deviceName']);
  if (deviceName != null) {
    requestDefaultParamsModel.deviceName = deviceName;
  }
  final String? deviceOsVersion = jsonConvert.convert<String>(
      json['deviceOsVersion']);
  if (deviceOsVersion != null) {
    requestDefaultParamsModel.deviceOsVersion = deviceOsVersion;
  }
  return requestDefaultParamsModel;
}

Map<String, dynamic> $RequestDefaultParamsModelToJson(
    RequestDefaultParamsModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['appVersion'] = entity.appVersion;
  data['sessionId'] = entity.sessionId;
  data['adid'] = entity.adid;
  data['deviceId'] = entity.deviceId;
  data['deviceName'] = entity.deviceName;
  data['deviceOsVersion'] = entity.deviceOsVersion;
  return data;
}

extension RequestDefaultParamsModelExtension on RequestDefaultParamsModel {
  RequestDefaultParamsModel copyWith({
    String? appVersion,
    String? sessionId,
    String? adid,
    String? deviceId,
    String? deviceName,
    String? deviceOsVersion,
  }) {
    return RequestDefaultParamsModel()
      ..appVersion = appVersion ?? this.appVersion
      ..sessionId = sessionId ?? this.sessionId
      ..adid = adid ?? this.adid
      ..deviceId = deviceId ?? this.deviceId
      ..deviceName = deviceName ?? this.deviceName
      ..deviceOsVersion = deviceOsVersion ?? this.deviceOsVersion;
  }
}